package org.jeecg.common.validation.validators;

import org.jeecg.common.validation.constraints.NotBlankButCanNull;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

public class NotBlankButCanNullValidator implements ConstraintValidator<NotBlankButCanNull, String> {
    @Override
    public boolean isValid(String value, ConstraintValidatorContext context) {
        return value==null || !value.trim().isEmpty();
    }
}
